<?php
/*
 * RouterException
 * 
 * Excepció que gestiona els errors de la classe router
 */
class TemplateException extends exception {

	const ERR_OVERWRITE_VAR = 0;
	const ERR_TEMPLATE_NOT_FOUND = 1;
	
	const ERR_OVERWRITE_VAR_TXT = "Intent de reescriptura d'una variable";
	const ERR_TEMPLATE_NOT_FOUND_TXT = "Template no trobat";
	
	
	private $aTxtError = array(self::ERR_OVERWRITE_VAR => self::ERR_OVERWRITE_VAR_TXT,
							self::ERR_TEMPLATE_NOT_FOUND => self::ERR_TEMPLATE_NOT_FOUND_TXT);

	private $aError;
	private $aCustomMsg;
	
	public function __construct($aError,$aMsg='') {
		$this->aError = $aError;
		$this->aCustomMsg = $aMsg != ''? ' ('.$aMsg.')' : '';
		parent::__construct($this->aTxtError[$this->aError].$this->aCustomMsg,$this->aError);
	}
	
/*	public function getMessage() {
		return $this->aTxtError[$this->aError].$this->aCustomMsg;
	} */
}  
?>
